using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;

public partial class Beta_fundies_controls_quotes_EditQuote : Controls.DataManagerQuoteControl
{
    private DAL.User CurrentUser
    {
        get
        {
            return Managers.UserLoginManager.CurrentUser;
        }
    }

    protected override void ItemChanged()
    {
        if (CurrentQuote != null && CurrentQuote.ApprovalStatus == DAL.Quote.QuoteStatus.Approved)
        {
            if (CurrentUser != null && CurrentUser.HasPermissions(DAL.User.UserStatus.Moderator))
            {
                mviewQuote.SetActiveView(viewQuote);
                EditQuoteForm1.CurrentQuote = CurrentQuote;
            }
            else
            {
                mviewQuote.SetActiveView(viewNoEdit);
            }
        }
        else
        {
            mviewQuote.SetActiveView(viewError);
        }
    }
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!Page.IsPostBack)
        {
            CurrentQuote = GetItemFromQueryString();
        }
    }
}
